<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .box{
            width: 150px;
            height: 180px;
            background-color: #369;
            margin: 100px auto;
            text-align: center;
        }
        .box p {text-align: center;
            line-height: 60px;
            font-size:12px;
            color: #fff;
        }
        .box span{
            display: block;
            width: 75px;
            height: 75px;
            margin: 0 auto;
            font-size:50px;
            color: #000;
            background-color: yellowgreen;
            line-height: 75px;
        }
    </style>
    <script>
        window.onload = function(){
           var box = document.getElementById("box");
            var boys = box.children;
             //日期函数
            var arr = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
             var date = new Date();   // 声明日期函数
             boys[0].innerHTML = date.getFullYear()+"年"+ (date.getMonth()+1) +
             "月" + date.getDate() + "日" + "  " + arr[date.getDay()];
             boys[1].innerHTML = date.getDate();  // 今天的日子
        }
    </script>
</head>
<body>
<div class="box" id="box">
    <p></p>
    <span></span>
</div>
</body>
</html>